package com.niiwoo.civet.trade.service.dubbo.orgloan;

import com.alibaba.dubbo.config.annotation.Service;
import com.niiwoo.civet.trade.dto.request.orgloan.LoanOrgInfoResponseDTO;
import com.niiwoo.civet.trade.dto.request.orgloan.OrgLoanInvestProjectRequestDTO;
import com.niiwoo.civet.trade.dto.response.orgloan.QueryOrgLoanContractReponseDTO;
import com.niiwoo.civet.trade.dto.response.orgloan.QueryOrgLoanInvestInfoReponseDTO;
import com.niiwoo.civet.trade.service.local.orgloan.OrgLoanService;
import com.niiwoo.civet.trade.service.orgloan.OrgLoanDubboService;
import com.niiwoo.tripod.provider.dto.response.PageResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by daizhiyue on 2017/12/14.
 */
@Service(version = "1.0.0", validation = "true")
public class OrgLoanDubboServiceImpl implements OrgLoanDubboService {

    @Autowired
    private OrgLoanService orgLoanService;

    /**
     * 信用借查询投资记录
     *
     * @param requestDTO
     * @return
     */
    @Override
    public PageResponseDTO<QueryOrgLoanInvestInfoReponseDTO> queryOrgLoanInvestInfoByProjectId(OrgLoanInvestProjectRequestDTO requestDTO) {

        return orgLoanService.queryOrgLoanProjectInfoList(requestDTO);
    }
    /**
     * 信用借查询合同参数
     *
     * @param userId
     * @return
     */
    @Override
    public QueryOrgLoanContractReponseDTO queryOrgLoanContractParas(Long projectId, String userId) {

        return orgLoanService.queryOrgLoanContractParas(projectId, userId) ;
    }

    /**
     * 判断用户是否存在信用借
     */
    @Override
    public int queryOrgLoanProject(String userId) {

        return orgLoanService.queryOrgLoanProject(userId);
    }

}
